package Code.System;

public class SystemDemo3 {
    public static void main(String[] args) {

        int[] arr1 = {1,2,3,4,5,6};
        int[] arr2 = new int[6];

        //将数组一拷贝到数组二中
        //参数：(数据源数组，起始索引，目的地数组，起始索引，拷贝个数)
        System.arraycopy(arr1,0,arr2,0,6);

        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
        System.out.println();

        int[] arr3 = new int[9];
        //000123000
        System.arraycopy(arr1,3,arr3,3,3);
        for (int i = 0; i < arr3.length; i++) {
            System.out.print(arr3[i] + " ");
        }
    }
}
